import Vue from 'vue'
import VueRouter from 'vue-router'
import mobileHome from '../views/mobile/Home.vue'
import pcHome from '../views/pc/Home.vue'

Vue.use(VueRouter)

  const routes = [
  {
    path: '/mobile',
    name: 'Mobile',
    component: mobileHome
  },
  {
    path: '/pc',
    name: 'Pc',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: pcHome
  }
]
const originalReplace = VueRouter.prototype.replace;
VueRouter.prototype.replace = function replace(location) {
    return originalReplace.call(this, location).catch(err => err);
};
const router = new VueRouter({
  routes
})

export default router
